home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / c / PhoneLogDevKit.lha / PhoneLog / src / PhoneLogParserInterface.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-16  |  3.0 KB  |  152 lines

  1.  /* Copyright © 1996 Kai Hofmann. All rights reserved. */
  2.  
  3.  #include "PhoneLogParserInterface.h"
  4.  #include "PhoneLog.h"
  5.  #include "PhoneLogScanner.h"
  6.  #include "PhoneLogParser.h"
  7.  
  8.  
  9.  int ParsePhoneLogFile(char *filename)
  10.  
  11. /*
  12. ******* PhoneLogParser/ParsePhoneLogFile ************************************
  13. *
  14. *   NAME
  15. *    ParsePhoneLogFile -- Parse a log file (V33)
  16. *
  17. *   SYNOPSIS
  18. *    NumOfParseErrs = ParsePhoneLogFile(name);
  19. *
  20. *    int ParsePhoneLogFile(char *filename);
  21. *
  22. *   FUNCTION
  23. *    Parse a log file.
  24. *
  25. *   INPUTS
  26. *    name - The name of the log file.
  27. *
  28. *   RESULT
  29. *    NumOfParseErrs - Number of occured parse errors.
  30. *
  31. *   EXAMPLE
  32. *    ...
  33. *    if (ParsePhoneLogFile("AmiTCP:log/AmiLog.log") != 0)
  34. *     {
  35. *      \* Parse errors have occured *\
  36. *     }
  37. *    ...
  38. *
  39. *   NOTES
  40. *    This function uses  InsertPhoneLogEntry() and InsertPhoneLogMark()
  41. *    as callback functions so that you can insert parsed datas into your
  42. *    program.
  43. *
  44. *   BUGS
  45. *    No known bugs.
  46. *
  47. *   SEE ALSO
  48. *    InsertPhoneLogEntry(), InsertPhoneLogMark()
  49. *
  50. *****************************************************************************
  51. *
  52. *
  53. */
  54.  
  55.   {
  56.    int NumOfParseErrs;
  57.  
  58.    PhoneLogScanner_BeginFile(filename);
  59.    NumOfParseErrs = PhoneLogParser();
  60.    ClosePhoneLogParser();
  61.    PhoneLogScanner_CloseFile();
  62.    return(NumOfParseErrs);
  63.   }
  64.  
  65.  
  66.  void InsertPhoneLogEntry(struct PhoneLogEntry *item)
  67.  
  68. /*
  69. ******* PhoneLogParser/InsertPhoneLogEntry **********************************
  70. *
  71. *   NAME
  72. *    InsertPhoneLogEntry -- Insert a parsed entry into your program (V33)
  73. *
  74. *   SYNOPSIS
  75. *    InsertPhoneLogEntry(item);
  76. *
  77. *    void InsertPhoneLogEntry(struct PhoneLogEntry *item);
  78. *
  79. *   FUNCTION
  80. *    This function will be called by the parser to insert a phone log
  81. *    entry into your software.
  82. *    So please modify the function body according to your needs!
  83. *
  84. *   INPUTS
  85. *    item - PhoneLogEntry structure to insert into your program.
  86. *
  87. *   RESULT
  88. *    None
  89. *
  90. *   NOTES
  91. *    Don't forget to return to the parser after you have inserted the
  92. *    item into your program!
  93. *
  94. *   BUGS
  95. *    No known bugs.
  96. *
  97. *   SEE ALSO
  98. *    ParsePhoneLogFile(), InsertPhoneLogMark()
  99. *
  100. *****************************************************************************
  101. *
  102. *
  103. */
  104.  
  105.   {
  106.    return;
  107.   }
  108.  
  109.  
  110.  void InsertPhoneLogMark(struct PhoneLogMarker *item)
  111.  
  112. /*
  113. ******* PhoneLogParser/InsertPhoneLogMark ***********************************
  114. *
  115. *   NAME
  116. *    InsertPhoneLogMark -- Insert a parsed mark into your program (V33)
  117. *
  118. *   SYNOPSIS
  119. *    InsertPhoneLogMark(item);
  120. *
  121. *    void InsertPhoneLogMark(struct PhoneLogMarker *item);
  122. *
  123. *   FUNCTION
  124. *    This function will be called by the parser to insert a phone log
  125. *    mark into your software.
  126. *    So please modify the function body according to your needs!
  127. *
  128. *   INPUTS
  129. *    item - PhoneLogMarker structure to insert into your program.
  130. *
  131. *   RESULT
  132. *    None
  133. *
  134. *   NOTES
  135. *    Don't forget to return to the parser after you have inserted the
  136. *    item into your program!
  137. *
  138. *   BUGS
  139. *    No known bugs.
  140. *
  141. *   SEE ALSO
  142. *    ParsePhoneLogFile(), InsertPhoneLogEntry()
  143. *
  144. *****************************************************************************
  145. *
  146. *
  147. */
  148.  
  149.   {
  150.    return;
  151.   }
  152.